#ifndef __SEM_H__
#define __SEM_H__

union semun { 
  int val;                /* value for SETVAL */
  struct semid_ds* buf;   /* buffer for IPC_STAT, IPC_SET */
  unsigned short* array;  /* array for GETALL, SETALL */
                          /* Linux specific part: */
  struct seminfo* __buf;  /* buffer for IPC_INFO */
}; 

extern int sem_init();
extern int sem_unlock(int semid);
extern int sem_lock(int semid);

extern int flock_init(char* lock_template);
extern int file_unlock(int fd, int offset);
extern int file_rlock(int fd, int offset);
extern int file_wlock(int fd, int offset);

#endif
